<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Admin</title>
    <include file="layout/style"/>
</head>

<body>

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="login-panel panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">请登录</h3>
                </div>
                <div class="panel-body">
                    <form method="post" onsubmit="return ckform();">
                        <div class="form-group">
                            <input class="form-control" name="username" placeholder="账号">
                        </div>
                        <div class="form-group">
                            <input class="form-control" name="password" type="password" placeholder="密码">
                        </div>
                        <div class="form-group">
                            <input class="form-control" name="verify" placeholder="验证码">
                        </div>
                        <div class="form-group">
                            <img id="verifyImg" onclick="fleshVerify()" title="刷新">
                        </div>
                        <input type="submit" class="btn btn-lg btn-success btn-block" value="登录" name="sub">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>

<script>
    function fleshVerify() {
        document.getElementById('verifyImg').src = "{:U('Admin/Auth/verify',array('t'=>NOW_TIME))}";
    }
    fleshVerify();

    function ckform() {
        var ck = new Array(
                document.getElementsByName("username")[0],
                document.getElementsByName("password")[0],
                document.getElementsByName("verify")[0]
        );
        for (var i = 0; i < ck.length; i++) {
            if (!ck[i].value) {
                ck[i].focus();
                return false;
            }
        }

        return true;
    }
</script>